import request from '@/utils/request.js'

// 获取全部视频列表
export const getAllVideos = (offset = 0) => {
  return request({
    methods: 'GET',
    url: '/video/timeline/all',
    params: { offset }
  })
}

// 获取推荐视频
export const getRecomVideos = (offset = 0) => {
  return request({
    methods: 'GET',
    url: '/video/timeline/recommend',
    params: { offset }
  })
}
// 获取视频标签列表
export const getVideoTags = () => {
  return request({
    methods: 'GET',
    url: '/video/group/list'
  })
}

// 获取视频分类列表
export const getVideoTypes = () => {
  return request({
    methods: 'GET',
    url: '/video/category/list'
  })
}
// 获取视频标签/分类下的视频
export const getVideosOfAType = (id, offset = 0) => {
  return request({
    methods: 'GET',
    url: '/video/group',
    params: { id, offset }
  })
}

// 获取视频url
export const getVideoUrl = (id) => {
  return request({
    methods: 'GET',
    url: '/video/url',
    params: { id }
  })
}

// 获取视频点赞转发评论数数据
export const getVideoInfo = (id) => {
  return request({
    methods: 'GET',
    url: '/video/detail/info',
    params: { vid: id }
  })
}

// 相关视频
export const getRelatedVideo = (id) => {
  return request({
    methods: 'GET',
    url: '/related/allvideo',
    params: { id: id }
  })
}

// 视频详情
export const getVideo = (id) => {
  return request({
    methods: 'GET',
    url: '/video/detail',
    params: { id: id }
  })
}
